import request from '../../utils/request'
/* 
车队信息
查看
*/

export let zCarInfo = () => {
    return request({
        url: "/zCarInfo",
        method: "GET",
    })
}
/* 
增加
*/
export let zCarInfoCreate = (carid, carName) => {
    return request({
        url: "/zCarInfo",
        method: "POST",
        data: {
            carid,
            carName

        }
    })
}
/* 
删除
*/
export let zdeleteInfo = (id) => {
    return request({
        url: "/zCarInfo/" + id,
        method: "DELETE",

    })
}

/* 
修改

*/
export let zupdateinfo = (id, carid, carName) => {
    return request({
        url: "/zCarInfo/" + id,
        method: "PATCH",
        data: {
            carName,
            carid
        }
    })
}
/* 
=======================
车辆配件查看
*/

export let zCarPart = () => {
    return request({
        // url:"http://10.35.161.16:8200/accessory/findAll",
        url:"/accessory/findAll",
        method:"GET",
    })
}
/* 
车辆配件新增
*/
export let zUpdataCarPart = (accessory_code, accessory_name, campany, unit_price) => {
    return request({
        // url:"http://10.35.161.16:8200/accessory/save",
        url:"/accessory/save",
        method:"POST",
        data: {
            accessory_code,
            accessory_name,
            campany,
            unit_price
        }
    })
}

/* 
车辆配件修改
*/
export let zCreCarPart=(accessory_code,accessory_name,campany,unit_price)=>{
    return request({
        // url:"http://10.35.161.16:8200/accessory/update",
        url:"/accessory/update",
        method:"POST",
        data:{
            accessory_code,
            accessory_name,
            campany,
            unit_price
        }
    })
}

/* 
车辆配件删除
*/
export let zDeleteCarPart=(accessory_code)=>{
    return request({
        // url:"http://10.35.161.16:8200/accessory/delete",
        url:"/accessory/delete",
        method:"DELETE",
        params:{
            accessory_code
        }
    })
}
/* 
车辆配件搜索
*/
export let zSearchCarPart=(search)=>{
    return request({
        // url:"http://10.35.161.16:8200/accessory/search",
        url:"/accessory/search",
        method:"GET",
        params:{
            search
        }
    })
}

/* 
==========================
车辆信息查看

*/
export let zVehicleInfo = () => {
    return request({
        url:"/carinfo/findAll",
        method:"GET",
    })
}
/* 
车辆信息新增
*/

export let zCreateVehicleInfo = (
    car_number,
    driver,
    purchase_price,
    color,
    car_type,
    car_img,
    )=>{
    return request({
        url:"/carinfo/insert",
        method:"GET",
        params:{
            car_number,
            driver,
            car_img,
            color,   
            car_type,
            purchase_price,
        }
    })
}
/* 
车辆信息删除
*/
export let zDeleteVehicleInfo=(car_number)=>{
    return request({
        url:"/carinfo/delete",
        method:"DELETE",
        params:{
            car_number
        }
    })
}
/* 
修改车辆信息
        url:"http://tzkgbh.natappfree.cc/carinfo/update",

*/
export let zUpVehicleInfo=(
    car_number,
    driver,
    purchase_price,
    color,
    car_type,
    car_img,
)=>{
    return request({
        url:"/carinfo/update",
        method:"POST",
        data:{
            car_number,
            driver,
            purchase_price,
            color,
            car_type,
            car_img,
        }
    })
}
/* 
车辆信息
搜索

carinfo/searchKey
*/

export let zSearchVehicleInfo=(car_type)=>{
    return request({
        url:"/carinfo/searchKey",
        method:"GET",
        params:{
            car_type
        }
    })
}